import Vue from "vue";
import VueRouter from "vue-router";
import HomeView from "../views/HomeView.vue";
import IndexUser from "../views/IndexUser.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/dog",
    name: "dog",
    component: () => import("../views/Dogcare.vue"),
  },

  { path: "/dog1", name: "dog1", component: () => import("../views/Dog1.vue") },
  {
    path: "/cat",
    name: "cat",
    component: () => import("../views/Catcare.vue"),
  },
  {
    path: "/cat1",
    name: "cat1",
    component: () => import("../views/Cat1.vue"),
  },
  {
    path: "/indexuser",
    name: "IndexUser",
    component: IndexUser,
    redirect: "/indexuser/userdata",
    children: [
      {
        path: "userdata",
        name: "Userdata",
        component: () => import("../views/Userdata.vue"),
      },
      {
        path: "password",
        name: "Password",
        component: () => import("../views/Password.vue"),
      },
      {
        path: "orderform",
        name: "OrderForm",
        component: () => import("../views/OrderForm.vue"),
        children: [
          {
            path: "orderlist",
            name: "OrderList",
            component: () => import("../views/OrderList.vue"),
          },
        ],
      },
      {
        path: "add",
        name: "Add",
        component: () => import("../views/Add.vue"),
      },
      {
        path: "topup",
        name: "TopUp",
        component: () => import("../views/TopUp.vue"),
      },
      {
        path: "balance",
        name: "Balance",
        component: () => import("../views/Balance.vue"),
      },
      {
        path: "browse",
        name: "Browse",
        component: () => import("../views/Browse.vue"),
      },
      {
        path: "quit",
        name: "Quit",
        component: () => import("../views/Quit.vue"),
      },
      {
        path: "merchant",
        name: "Merchant",
        component: () => import("../views/Merchant.vue"),
      },
      {
        path: "issue",
        name: "Issue",
        component: () => import("../views/Issue.vue"),
      },
      {
        path: "merchantsOrders",
        name: "MerchantsOrders",
        component: () => import("../views/MerchantsOrders.vue"),
      },
      {
        path: "authentication",
        name: "Authentication",
        component: () => import("../views/Authentication.vue"),
      },
      {
        path: "earnestMoney",
        name: "EarnestMoney",
        component: () => import("../views/EarnestMoney.vue"),
      },
    ],
  },
  {
    path: "/",
    name: "home",
    redirect: "/index",
    component: HomeView,
  },
  {
    path: "/index",
    name: "index",
    component: () => import("../views/IndexView.vue"),
  },
  {
    path: "/register",
    name: "Register",
    meta: {
      hideHeader: true,
    },

    component: () => import("../views/Register.vue"),
  },
  {
    path: "/login",
    name: "Login",
    meta: {
      hideHeader: true,
    },

    component: () => import("../views/Login.vue"),
  },
  {
    path: "/store",
    name: "store",
    component: () => import("../views/StoreView.vue"),
  },
  {
    path: "/buydog",
    name: "BuyDog",
    component: () => import("../views/Buydog.vue"),
  },
  {
    path: "/tianyuandog",
    name: "TYdog",
    component: () => import("../views/TianyuanDog.vue"),
  },
  {
    path: "/pet_detail",
    name: "Petdetail",
    component: () => import("../views/Petdetail.vue"),
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
